#include<iostream>
#include<vector>
class Solution {
public:
	int missingNumber(std::vector<int>& nums) {
		int n = nums.size();
		int a = n;
		int b = 0;
		for (int  i = 0; i < n; i++) {
			a ^= i;
			b ^= nums[i];
		}
		return b ^ a;
	}
};

